package cn.lili.modules.order.order.entity.dos;

import cn.lili.common.utils.BeanUtil;
import cn.lili.modules.distribution.entity.dto.DistributionApplyDTO;
import cn.lili.modules.distribution.entity.enums.DistributionStatusEnum;
import cn.lili.mybatis.model.BaseStandardEntity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.util.Date;

/**
 * <p>
 * 排名活动-店主表
 * </p>
 *
 * @author author
 * @since 2023-12-25
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("li_ranking_distribution")
@ApiModel(value="RankingDistribution对象", description="排名活动-店主表")
@NoArgsConstructor
public class RankingDistribution extends BaseStandardEntity {
    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    public RankingDistribution(String memberId, String memberName, DistributionApplyDTO distributionApplyDTO) {
        this.memberId = memberId;
        this.memberName = memberName;
        this.level = 0;
        this.directOrderNumber = 0;
        distributionOrderCount = 0;
        this.distributionStatus = DistributionStatusEnum.APPLY.name();
        BeanUtil.copyProperties(distributionApplyDTO, this);
    }




    @ApiModelProperty(value = "可提现金额")
    private BigDecimal canRebate;

    @ApiModelProperty(value = "冻结金额")
    private BigDecimal commissionFrozen;

    @ApiModelProperty(value = "店主状态")
    private String distributionStatus;

    @ApiModelProperty(value = "用户ID")
    private String memberId;

    @ApiModelProperty(value = "用户名称")
    private String memberName;

    @ApiModelProperty(value = "分销总额")
    private BigDecimal rebateTotal;

    @ApiModelProperty(value = "身份证号")
    private String idNumber;

    @ApiModelProperty(value = "姓名")
    private String name;

    @ApiModelProperty(value = "分销订单数")
    private Integer distributionOrderCount;

    @ApiModelProperty(value = "银行开户行")
    private String settlementBankAccountName;

    @ApiModelProperty(value = "银行开户账号")
    private String settlementBankAccountNum;

    @ApiModelProperty(value = "银行开户支行")
    private String settlementBankBranchName;

    @ApiModelProperty(value = "等级，级别，默认1预留的")
    private Integer level;

    @ApiModelProperty(value = "直推订单数（只要下单就算）")
    private Integer directOrderNumber;

    @ApiModelProperty(value = "总佣金（已结算，待结算，已退单都计算）")
    private BigDecimal grossCommission;

    @ApiModelProperty(value = "审核时间(通过-开通时间)")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date auditTime;

    @ApiModelProperty(value = "上级id")
    private String parentId;
    @ApiModelProperty(value = "上级账号id")
    private String parentFyName;

    @ApiModelProperty("下级人数")
    private Integer childCount;

    @ApiModelProperty("飞语商城账号id--用于前端显示")
    private String fyName;
    @ApiModelProperty("飞语商城账号--用于前端显示")
    private String account;

}
